package net.orange.framework.logic;

import java.util.Collection;

import net.orange.architecture.process.IBaseProcess;
import net.orange.framework.model.Group;
import net.orange.framework.model.Resource;

/**
 * The interface of resource business delegate process object, to retrieve , save ,
 * remove or process other operation for the resource object.
 */
public interface IResourceProcess extends IBaseProcess {
	/**
	 * Find the resource by the key (resource url). It will search in the cache
	 * first. If it cann't find in the cache, it will load from database.
	 * 
	 * @param key
	 *            The resource key (resource url).
	 * @return The target resource.
	 * @throws Exception
	 */
	public Resource findByKey(String key) throws Exception;

	/**
	 * Find the resources under the target group
	 * 
	 * @param group
	 *            The target group.
	 * @return The users under the target department
	 * @throws Exception
	 */
	public Collection findByGroup(Group group) throws Exception;
}